package com.esri.core.renderer;

import com.esri.core.internal.util.d;
import com.esri.core.map.Feature;
import com.esri.core.map.Graphic;
import com.esri.core.symbol.Symbol;
import com.esri.core.symbol.SymbolHelper;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonNode;

/* loaded from: classes.dex */
public class SimpleRenderer extends BaseRenderer {
    public static final String TYPE = "simple";
    private static final long serialVersionUID = 1;
    String d;
    String e;
    Symbol f;

    @Override // com.esri.core.renderer.BaseRenderer
    protected String getType() {
        return TYPE;
    }

    public SimpleRenderer(JsonNode jsonNode) throws Exception {
        super(jsonNode);
        this.f = null;
        if (jsonNode == null) {
            return;
        }
        JsonNode jsonNode2 = jsonNode.get("symbol");
        if (jsonNode2 != null) {
            this.f = SymbolHelper.parseSymbol(jsonNode2);
        }
        JsonNode jsonNode3 = jsonNode.get("label");
        if (jsonNode3 != null) {
            this.d = jsonNode3.getTextValue();
        }
        JsonNode jsonNode4 = jsonNode.get("description");
        if (jsonNode4 != null) {
            this.e = jsonNode4.getTextValue();
        }
    }

    public SimpleRenderer(Symbol symbol) {
        this.f = null;
        this.f = symbol;
    }

    @Deprecated
    public Symbol getSymbol(Graphic graphic) {
        return getSymbol((Feature) graphic);
    }

    public String getLabel() {
        return this.d;
    }

    public void setLabel(String str) {
        this.d = str;
    }

    public String getDescription() {
        return this.e;
    }

    public void setDescription(String str) {
        this.e = str;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // com.esri.core.renderer.BaseRenderer
    public void toJson(JsonGenerator jsonGenerator) throws Exception {
        super.toJson(jsonGenerator);
        d.a(jsonGenerator, "label", this.d);
        if (this.f != null) {
            jsonGenerator.writeFieldName("symbol");
            jsonGenerator.writeRaw(':');
            jsonGenerator.writeRaw(this.f.toJson());
        }
    }

    public int hashCode() {
        Symbol symbol = this.f;
        return 31 + (symbol == null ? 0 : symbol.hashCode());
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj != null && getClass() == obj.getClass()) {
            SimpleRenderer simpleRenderer = (SimpleRenderer) obj;
            Symbol symbol = this.f;
            if (symbol == null) {
                if (simpleRenderer.f != null) {
                    return false;
                }
            } else if (!symbol.equals(simpleRenderer.f)) {
                return false;
            }
            return true;
        }
        return false;
    }

    @Override // com.esri.core.renderer.Renderer
    public Symbol getSymbol(Feature feature) {
        return this.f;
    }
}
